/**
 * 
 */
package design_pattern.command.awt.undo;

import java.awt.Button;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.util.Stack;

/**
 * @author linzq
 * 
 */
public abstract class Command extends Button {

  private static final long serialVersionUID = -5438122933240653951L;

  protected static Stack<Command> commands = new Stack<>();

  protected static int index = 0;

  protected Panel p;

  public Command(String caption, Panel p) {
    super(caption);
    this.p = p;
  }

  public abstract void execute(ActionEvent e);

}
